package library.and.xps.com.step.view.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;

import library.and.xps.com.step.R;
import library.and.xps.com.step.util.CommonUtils;
import library.and.xps.com.step.view.fragment.SettingsFragment;

public class SettingActivity extends AppCompatActivity {
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_settings);

        ActionBar actionBar = getSupportActionBar();
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setHomeAsUpIndicator(R.mipmap.back);

        CommonUtils.replaceFragment(R.id.settings_container,new SettingsFragment(),getSupportFragmentManager());
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

        switch (item.getItemId()){
            case  android.R.id.home:
                finish();
                break;
        }

        return super.onOptionsItemSelected(item);
    }

}
